<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>个性化地图</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<style type="text/css">
html,body{
  width:100%;
  height:100%;
}
*{
  margin:0px;
  padding:0px;
}
body {
  font: 12px/16px Verdana, Helvetica, Arial, sans-serif;
}
#container{
  min-width:600px;
  min-height:767px;
}

</style>
<script charset="utf-8" src="https://map.qq.com/api/js?v=2.exp&key=DJTBZ-L2RAW-PYMRR-OR2DW-45PJ6-ARFBO"></script>
<script>

function getQueryVariable(variable)
{
       var query = window.location.search.substring(1);
       var vars = query.split("&");
       for (var i=0;i<vars.length;i++) {
               var pair = vars[i].split("=");
               if(pair[0] == variable){return pair[1];}
       }
       return(false);
}

var zb=getQueryVariable('zb') ;
zb=zb.split(",")
console.log(zb[0])
  window.onload = function () {
    function init() {
      // 创建地图
      var map = new qq.maps.Map(document.getElementById("container"), {
        center: new qq.maps.LatLng(zb[0] , zb[1] ),      // 地图的中心地理坐标
        zoom: 13,     // 地图缩放级别
        mapStyleId: 'style1'  // 该key绑定的style1对应于经典地图样式，若未绑定将弹出无权限提示窗
      });

	  var infoWin = new qq.maps.InfoWindow({
        map: map
    });

    qq.maps.event.addListener(map,'zoom_changed',function() {
        var zoomLevel = map.getZoom();

      console.log('zoomLevel: ' + zoomLevel);
	  
	  window.parent.daoYo(zoomLevel);

    });

   var anchor = new qq.maps.Point(6, 6),
        size = new qq.maps.Size(30, 30),
        origin = new qq.maps.Point(0, 0),
        icon = new qq.maps.MarkerImage('../image/dw.gif', size, origin, anchor);
    var marker = new qq.maps.Marker({
        icon: icon,
        map: map,
        position:map.getCenter()});
    }
    //调用初始化函数
    init();


  }





</script>
</head>
<body>
<!--   定义地图显示容器   -->
<div id="container"></div>
</body>
</html>
